//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package pxb.android.zipalign;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.stream.Collectors;

public class Tool {
    public Tool() {
    }

    public static void main(String... args) throws IOException {
        if (args[0].equals("4k")) {
            FastZipIn in = new FastZipIn(new File(args[1]));
            Throwable var2 = null;

            try {
                FastZipOut out = new Always4KZipOut(new File(args[2]));
                Throwable var4 = null;

                try {
                    List<FastZipEntry> entries = (List)in.entries().stream().filter((e) -> {
                        return !e.utf8Name().endsWith("/");
                    }).collect(Collectors.toList());
                    out.copy(in, entries);
                } catch (Throwable var27) {
                    var4 = var27;
                    throw var27;
                } finally {
                    if (out != null) {
                        if (var4 != null) {
                            try {
                                out.close();
                            } catch (Throwable var26) {
                                var4.addSuppressed(var26);
                            }
                        } else {
                            out.close();
                        }
                    }

                }
            } catch (Throwable var29) {
                var2 = var29;
                throw var29;
            } finally {
                if (in != null) {
                    if (var2 != null) {
                        try {
                            in.close();
                        } catch (Throwable var25) {
                            var2.addSuppressed(var25);
                        }
                    } else {
                        in.close();
                    }
                }

            }
        }

    }

    static class Always4KZipOut extends FastZipOut {
        public Always4KZipOut(File out) throws IOException {
            super(out);
        }

        protected boolean isStorage4K(FastZipEntry e) {
            return true;
        }
    }
}
